#include "ast.h"

#include <iostream>
#include <sstream>

void IdentAST::visitor()
{
    std::string v;
    v = "<Identifier>: " + this->id;
    std::cout << v << std::endl;
}

void FuncDeclAST::visitor()
{
    std::string v;
    v = "<FuncDeclAST>: " ;
    std::cout << v << std::endl;
    this->id->visitor();
}

void FuncAST::visitor()
{
    std::string v;
    v = "<FuncAST>: ";
    std::cout << v << std::endl;
    this->Proto->visitor();
    //this->Body->visitor();
}

void FuncListAST::visitor()
{
    std::vector<FuncAST *>::iterator iter;
    for (iter = this->list.begin(); iter != this->list.end(); iter++) {
        (*iter)->visitor();
    }
}

FuncAST *FuncListAST::add(FuncAST *func)
{
    if (func != NULL) {
        list.push_back(func);
        //std::clog << func->
    }
    return func;
}
